# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>

_realname=qt5
pkgbase="mingw-w64-${_realname}"
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-debug")
pkgver=5.15.2
pkgrel=15
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
pkgdesc="Meta package for Qt5 components (mingw-w64)"
url='https://www.qt.io/'
license=('GPL3' 'LGPL' 'FDL' 'custom')
source=('README.md')
sha256sums=('a010bc8ff2ea7b26e4bfe866912d8ab021b5b188fde071466c58dbff17d50132')

package_qt5() {
  depends=(
    "${MINGW_PACKAGE_PREFIX}-qt5-3d"
    "${MINGW_PACKAGE_PREFIX}-qt5-activeqt"
    "${MINGW_PACKAGE_PREFIX}-qt5-base"
    "${MINGW_PACKAGE_PREFIX}-qt5-charts"
    "${MINGW_PACKAGE_PREFIX}-qt5-connectivity"
    "${MINGW_PACKAGE_PREFIX}-qt5-datavis3d"
    "${MINGW_PACKAGE_PREFIX}-qt5-declarative"
    "${MINGW_PACKAGE_PREFIX}-qt5-gamepad"
    "${MINGW_PACKAGE_PREFIX}-qt5-graphicaleffects"
    "${MINGW_PACKAGE_PREFIX}-qt5-imageformats"
    "${MINGW_PACKAGE_PREFIX}-qt5-location"
    "${MINGW_PACKAGE_PREFIX}-qt5-lottie"
    "${MINGW_PACKAGE_PREFIX}-qt5-multimedia"
    "${MINGW_PACKAGE_PREFIX}-qt5-networkauth"
    "${MINGW_PACKAGE_PREFIX}-qt5-purchasing"
    "${MINGW_PACKAGE_PREFIX}-qt5-quick3d"
    "${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols"
    "${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols2"
    "${MINGW_PACKAGE_PREFIX}-qt5-quicktimeline"
    "${MINGW_PACKAGE_PREFIX}-qt5-remoteobjects"
    "${MINGW_PACKAGE_PREFIX}-qt5-script"
    "${MINGW_PACKAGE_PREFIX}-qt5-scxml"
    "${MINGW_PACKAGE_PREFIX}-qt5-sensors"
    "${MINGW_PACKAGE_PREFIX}-qt5-serialbus"
    "${MINGW_PACKAGE_PREFIX}-qt5-serialport"
    "${MINGW_PACKAGE_PREFIX}-qt5-speech"
    "${MINGW_PACKAGE_PREFIX}-qt5-svg"
    "${MINGW_PACKAGE_PREFIX}-qt5-tools"
    "${MINGW_PACKAGE_PREFIX}-qt5-translations"
    "${MINGW_PACKAGE_PREFIX}-qt5-virtualkeyboard"
    "${MINGW_PACKAGE_PREFIX}-qt5-webchannel"
    "${MINGW_PACKAGE_PREFIX}-qt5-webglplugin"
    "${MINGW_PACKAGE_PREFIX}-qt5-websockets"
    "${MINGW_PACKAGE_PREFIX}-qt5-webview"
    "${MINGW_PACKAGE_PREFIX}-qt5-winextras"
    "${MINGW_PACKAGE_PREFIX}-qt5-xmlpatterns")
}

package_qt5-debug() {
  depends=(
    "${MINGW_PACKAGE_PREFIX}-qt5-3d-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-activeqt-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-base-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-charts-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-connectivity-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-datavis3d-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-declarative-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-gamepad-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-graphicaleffects-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-imageformats-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-location-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-lottie-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-multimedia-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-networkauth-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-purchasing-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-quick3d-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols2-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-quicktimeline-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-remoteobjects-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-script-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-scxml-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-sensors-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-serialbus-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-serialport-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-speech-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-svg-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-tools-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-virtualkeyboard-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-webchannel-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-webglplugin-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-websockets-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-webview-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-winextras-debug"
    "${MINGW_PACKAGE_PREFIX}-qt5-xmlpatterns-debug")
}

# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :

# generate wrappers
for _name in "${pkgname[@]}"; do
  _short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
  _func="$(declare -f "${_short}")"
  eval "${_func/#${_short}/package_${_name}}"
done
# template end;
